import request from '@/utils/request'

export function getWechatApi(data) {
  return request({
    url: "/api/ucenter.passport/wechat",
    method: "post",
    data,
  });
}


// 获取用户信息
export function getInfo() {
  return request({
    url: '/api/ucenter.user/info',
    method: 'post'
  })
}

// 获取用户列表
export function getUserListApi(data) {
  return request({
    url: '/api/ucenter.user/index',
    method: 'post',
    data
  })
}

// 获取用户列表
export function getAllUserApi(data) {
  return request({
    url: '/api/ucenter.user/getAllUser',
    method: 'post',
    data
  })
}

export function logout() {
//   return request({
//     url: '/av/ucenter.user/logout',
//     method: 'post'
//   })
}

// 新增用户
export function createUserApi(data) {
  return request({
    url: '/api/ucenter.user/create',
    method: 'post',
    data
  })
}

// 编辑用户
export function saveUserApi(data) {
  return request({
    url: '/api/ucenter.user/save',
    method: 'post',
    data
  })
}

// 编辑用户角色
export function bindUserRoleApi(data) {
  return request({
    url: '/api/ucenter.grant/bindRole',
    method: 'post',
    data
  })
}

// 获取用户角色
export function getUserRoleApi(data) {
  return request({
    url: '/api/ucenter.grant/getRole',
    method: 'post',
    data
  })
}

// 读取用户信息
export function readUserApi(data) {
  return request({
    url: '/api/ucenter.user/read',
    method: 'post',
    data
  })
}

// 获取用户基本信息
export function getUserInfoApi() {
  return request({
    url: '/api/ucenter.user/info',
    method: 'post',
  })
}

// 删除用户
export function deleteUserApi(data) {
  return request({
    url: '/api/ucenter.user/delete',
    method: 'post',
    data
  })
}

export function changePwdApi(data) {
    return request({
        url: '/api/ucenter.user/password',
        method: 'post',
        data
    })
}


export function readConfigApi(data) {
  return request({
    url: '/api/ucenter.config/read',
    method: 'post',
    data
  })
}

export function saveConfigApi(data) {
  return request({
    url: "/api/ucenter.config/save",
    method: "post",
    data,
  });
}

export function bindWechatApi(data) {
  return request({
    url: "/api/ucenter.user/bindWechat",
    method: "post",
    data,
  });
}
